home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11068 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: newsflash.concordia.ca!not-for-mail
  2. From: v_ruso@alcor.concordia.ca
  3. Newsgroups: comp.lang.c
  4. Subject: Problem with scanf
  5. Date: Thu, 21 Mar 1996 22:52:59 GMT
  6. Organization: Concordia University, Montreal, Canada
  7. Message-ID: <4iscgb$8h9@newsflash.concordia.ca>
  8. NNTP-Posting-Host: alcor.concordia.ca
  9. NNTP-Posting-User: v_ruso
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. I am writing a program that is supposed to gather information from the
  13. user.
  14. The program works fine if the user enters some numbers and presses
  15. enter.  But if the user just presses enter without entering any data,
  16. the cursor just starts a new line.  
  17. Can anyone tell me how I can avoid this?
  18. this is the part of the code i am refering to:
  19. .
  20. .
  21. gotoxy (13,22);
  22.     cprintf ("The maximum load the cylinder is expected to handle");
  23.     gotoxy (15,10);
  24.     cprintf ("Enter the Maximum Axial Load [Lbf]: ");
  25.     xlocation = wherex();
  26.     gotoxy (xlocation,10);
  27.     scanf ("%f",&maxload);
  28.  
  29.  
  30. where maxload is a float type variable..
  31.  
  32. Any help would be appreciated.
  33.  
  34. Thanks.
  35. Vince R.
  36.  
  37.